cmake_minimum_required(VERSION 3.8)
project(agv_ftp_log)

# Default to C++14
if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang")
  add_compile_options(-Wall -Wextra -Wpedantic)
endif()

# Find dependencies
find_package(ament_cmake REQUIRED)
find_package(ament_cmake_python REQUIRED)
find_package(rclcpp REQUIRED)
find_package(rclpy REQUIRED)
find_package(std_msgs REQUIRED)
find_package(geometry_msgs REQUIRED)
find_package(rosidl_default_generators REQUIRED)
find_package(agv_srvs REQUIRED)

# Include directories
include_directories(
  include
  ${ament_INCLUDE_DIRS}
)

# Create executables
add_executable(agv_param_transform src/param_file.cpp)
ament_target_dependencies(agv_param_transform
  rclcpp
  std_msgs
  geometry_msgs
  agv_srvs
)

add_executable(log_file_config src/log_file.cpp)
ament_target_dependencies(log_file_config
  rclcpp
  std_msgs
  geometry_msgs
  agv_srvs
)

# Install executables
install(TARGETS
  agv_param_transform
  log_file_config
  DESTINATION lib/${PROJECT_NAME}
)

# Install launch files
install(DIRECTORY
  launch
  DESTINATION share/${PROJECT_NAME}
)

# Export dependencies
ament_export_dependencies(
  rclcpp
  rclpy
  std_msgs
  geometry_msgs
  rosidl_default_runtime
)

ament_package()